var VolumeModalDemo = angular.module('FusionStorUI.volume', []);
VolumeModalDemo.controller('VolumeModalCtrl', ['$scope','$modal', '$http', function($scope, $modal, $http) {
    var modalInstance;
    $scope.templateData = '';
    $scope.open = function(url) {  
        $scope.item = {};
        $http.get(url).success(function (data) {
            $scope.templateData = data;
            modalInstance = $modal.open({  
               template : $scope.templateData,
                backdrop:'static',  
                keyboard: false,
                controller : VolumeModalInstanceCtrl,  
                resolve : { 
                    item : function() {  
                        return $scope.item;  
                    }  
                }  
            });  

        });
    };  

    $scope.close = function() {
        modalInstance.dismiss('cancel');  
    }
}]); 
var VolumeModalInstanceCtrl = function($scope, $modalInstance, item) {  
    $scope.item = item;  
    $scope.selected = {  
        item : $scope.item 
    };  

    $scope.ok = function() {  
        submit_volume_create(false);
    };  

    $scope.volume_copy = function() {
        submit_volume_copy();
    };

    $scope.update = function() {
        submit_volume_update(false);
    };

    $scope.cancel = function() {  
        $modalInstance.dismiss('cancel');  
    };  
};  

